import java.util.HashSet;

public class text56 {

    public static int serach(String s1,String s2)
    {
        HashSet<Character>a=new HashSet<>();
        int i=0;
        for(i=0;i<s1.length();i++)
        {
            a.add(s1.charAt(i));
        }
        int count=0;
        for(i=0;i<s2.length();i++)
        {
            if(a.contains(s2.charAt(i)))
            {
                count++;

            }
        }
        return count;

    }
    public static void main(String[] args) {
        String s1="aAbC";
        String s2="aAAbbbc";
        int c=serach(s1,s2);
        System.out.println(c);

     */


    }
}
